Fixed some library functions