Fixed alphabetic sorting bugs, tweaked heuristics