Merge in functionality from transforms branch.