Fixes sorting