Improved unit tests and corrected bug in OS X Example.