more tests, fix common edge case