Blunt fix for null references errors.