Cross-Platform changes

added changes to be able to build on mac