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