Cut down on unnecessary blocks being created and fix a NPE.