Several compiler fixes, bugfixes, etc.