Fixed bug with library functions