Update to 1.6.2, fix a few logic errors