Replace newline characters with space.

Also replace double space with single space.