Several more tests and fixes to compiler