Remove trailing '\n'.