Fixed a few issues with Kotlin generation