Improve corner case checks.