Fix tests for py2/3 compat