Issue335

The bug was that we were sorting symbols instead of classes, which mean we picked the wrong class.

Fixes #335