Ensure comments are sorted. Fixes #718.