fixes to make it work on mac os x 10.9 mavericks