Fixed minor sorting bug