Merge linux and mac versions. Return error if Windows