Fix Authenticate bug and reformat