Replacing < / > with compareTo apparently fixes all the bugs, who knew?