Fix bug in lib