compatibility fixes for python 3.4

use items instead of iteritems