Fix bug with NO_REFERENCE mode