fix getReferenceUri() and added new tests