CSPACE-6302: Make sure a term has a generated shortid if none is specified, before checking if a term with the shortid already exists.
Merge pull request #129 from ray-lee/CSPACE-6302

CSPACE-6302: Making a tweak to the fix.