Fixed some issues on OSX.