Initial work on bug fixes for OS X.