some improvements to transposition handling