Fix dict.values for py3 compatibility and fixed inconsistent unit test