Changed sorting to recognise folder. Fixes #27.