Fixes to peek()

This PR is meant to address #1076. Also took the opportunity to try to normalize the plotting in lightcurves,
Before this `for hline in header` was outside the `while` that populates `header`.  Now this is inside, so if I'm not wrong, this loop run for each line we add in header.  So if there are 10 lines in the file, then it will run the loop 10! times.