Improve --nonewline and --keys and resolve excess whitespace issues