Fix mac builds Patch by Wolftrac.
Merge branch 'bugfixes'