Fixed bug in references