Fix lots of bugs

Now can get the result image correctly.
Need to do: get the result pointset (inverse transformation),
evaluation, run the tests