make builds work on linux and osx
fix compiler warnings