Minor refactoring of sign in functionality, error management for wrong password