fix some edge cases in tests