Updated tests for ref variable removal