Made changes for it to work on Mavericks