Fix removal of trailing whitespace