Fixed bugs so that existing tests passed
Fixed existing tests to match new implementation