Trailing spaces and carriage return handling.