Fix Mac OSX issues