Bugfixes for testcase 9