Osx compatible

Implemented issue #6: Make library OS X compatible