Makefiles and test suite improved for OS X