Bugfixes for build