Some fixes for test cases