Fixed bug with duplicate reference