Added compatibility with OS X