Fix compatibility with OS X