Deal with edge cases