Fix bug with not set authSuccessful variable in authenticate() method.
Fix misspellings and some minor refactor