Fix issue with transform when custom column name is used

See #664 for details