Fixes to auth