Remove trailing whitespace in pieces controller