update lib from JRS, fix tests