cleanup imports
don't fail if directory already exists
fix clang compilation warnings
fix build path on OS X