Detect Mac OS properly