Fixed bug in library