Various edge cases covered.