Fixed bug that prevented adding references.