Patches over email very easily lose CRLF line endings in files otherwise LF-only so I had to put them back where needed.