Refactoring transforms
Adding some hopefully useful tests
Minor fix