Add changes from Library spec
Fix minor bug