Fix issue #22. Sort type can be only mtime or asc.

This fix a bug in the cache. See issue #22 for more details.