Fixed errors in null stream referencing