Merge pull request #2 from adferguson/master

fixes to compile on OS X (tested 10.8.5)