Transform fixes 3610 3611

Fixes for these issues:
http://na-mic.org/Mantis/view.php?id=3610
http://na-mic.org/Mantis/view.php?id=3611

See details in the commit comments.

The commit 9a36f6f was left in accidentally, but it's a minor change that has been integrated into the Slicer core already, so I guess it should not cause any trouble.