Fixed bug that forced the reference list to allways be last