Fix bug and update lib