Ensure that input always contains the trailing line break

Related to issue #126