All of the changes were in this code.  These bugs are most likely regressions introduced when I changed code for case-free usernames.

The solution is to "get" with a default value of empty string, anywhere where the result could be used in a database query.