Cleanup.
Added missing utilities functions. Fixes import in python.