Some compatibility with OS X and refactors.