Fix Python FutureWarning about comparison with None
Don't reverse changes lines with 'tac'

Seems to eat a newline, too.