trim trailing spaces and tiny updates.