Further updates and bugfixes to engine