Minor fixes

Fixed minor issue with sorting
Merge pull request #819 from criticlmind/patch-3

Minor fixes