Misc. fixes.
Fix problem where patch was executing privilege logic before username was set.
swat
Swat
Merge pull request #625 from jrogelstad/master

Misc. fixes.