Improved authentication tests