bugfixes to compiler and new testcase trace