Set history length to two weeks, fix strange sqlite encoding issue