Fixed MacOS X compatibility bug (github issue #20)