Fix for Mac issues and some other stuff