Fix some cmake and mac stuff