correct reporting of invalid_reference