fixes to pass basic test cases