fixed up os-detection as per comments