Print last x lines in header

Segfaults for n < 3 and shows nothing for n = 15 and 16???