apply some fixes that were missed from SVN (dealing with null
substitutions)