Some authentication improvements