Update to 1.3.1, fix thread issues