Pull to fix sorting of resources etc

This fork looks useful, I would like to combine your work with my small change to use in my project. Thanks!