Language improvements and bugfixes