Authentication bugfixes.