Fixes to pass unit test