Removed unnecessary casts now that Kotlin compiler bug is fixed