fixed compilation problems for OS X