osx support and better error messages