Increase timeout and fix history write on python 3.