Fixed tests under Python3