Re-apply Ian's "kill off trailing whitespace" patch, previously unintentionally reverted.