Add more edge cases in unit tests