fixed linux and mac compilation errors