bug fixes

3 more tests added.