Bugfix: Add one function call for all references.

Previously, the code introduced multiple function calls, one for every
streaming store reference check. This patch fixes the code to have just one
call for all reference checks together.