Fixed convert bugs related to different Python 2/3 behaviour