Remove trailing spaces and fix ribbon