Fixes #7 - Fix sorting bug on nested resource