Fixed bug that I introduced while refactoring for references.