Fix number of newlines when inserting the references section