Fixed problems preventing build on OS X 10.9