Fixes to work on MacOS 10.9 (Mavericks)