Fix up trailing white-space

And add a hook to get rid of it going forward.