fixes to ensure jetha's changes work on Mac OS X