Fixed some variable names and included mac support