Fixing #5 by updating more specific SQL order subquery.
Merge pull request #9 from josin/master

Fixing issue with invalid SQL