Deal with python3's dict method changes [applied]