Minor fixes, all tests now pass