Correct logic dealing with parsing of indirect references.  Add test test cases for indirect references.