updated test to ignore assignment to null
fixed bug (ignored return value of addReferenceAndTarget)