Fixed erroenous cast to TreeMap