Fixed transformation regarding offsets.
Encountered a strange bug and left some debug output in code, remove after fixing. Please see #5