fix nullness violations

The StringUtils change is a weakness of Eclipse (not knowing such
libraries), but the other 2 are actual violations of our contract.