Fix issues with 500 from authentication