Added a sanity check before converting newlines.