improved exception-handling on Mac OS X / get rid of warnings