Leaner handling of null

Includes various clean-ups.