Update library and fix bug