python-level fixes for transform