Fixed authority code, tests working