MEDITE: bug fixes in transposition detection, make cost function configurable