Fix for issue 1740: passing the wrong argument to validate user
Getting rid of tabs :-(
more style fixes
Merge pull request #1745 from reidka/issue-1740

Fix for issue 1740: switching roles