Added further test, fixed several issues

Following issues where found and fixed: User not deleted, Exception when
logging in with a wrong username, SQL error when Logging in successfull