fixed minor sorting issues