AMEC-1974: fixed the extra space between References header and list of references when list of references is short. Now the extra space is at the end of the list of references as original intended and as in production.