Fixed login and registration validation bug