Added references option to cast object ids