Clean up, mac compatibility, etc.