Minor refactoring in gennull.