Fixes 362

This was a problem with the sortOrder not being derived correctly.
Merge pull request #363 from adaptlearning/issue/#362

Fixes 362