getstate bug fixed. testsuite for python 3 and 2.7