Fix ordering and remove trailing spaces.