Bugfix: correctly enable/disable sort buttons