Some authentication fixes