Various test framework fixes