bugfixes
compile on macosx