Improve Reference::equals