Attempted mac encoding fix

May or may not work