Fixes for compilation on linux and windows