Fix Library Bugs

Fix Library Bugs