Clean up globals, fix indentation