Added MacOS compatibility.