Fix tests for python3