Better testing of potentially-unset variables