Fixed library loading for OSX.