fixing compilation issues and syntacx from macos