Fixes to custom auth