More changes to better handle a null user object

A project I'm working on uses a null user object sometimes. The first
commit I made fixed some place that didn't handle that, this fixes more
of them
Merge pull request #8 from jonathantower/master

More changes to better handle a null user object