Added MacOS X compatibility fix