Correctly parse sort params

Signed-off-by: Ian Macalinao <me@ian.pw>