Suggestions for how to improve these edge cases are welcome.