fixup! Add missing corner case and test. Include debug prints for easier reviewing
fixup! Remove debug prints