Fix reversed-broken axes. Add test case.

Thanks to Sergey Gromov for spotting the bug.