Update for Python3.4 and fix a bug