Sort subjects alphabetically

Fixes #527