Fix some transform stuff, add some tests