Fix tests failing on Python versions before 3.3