Implemented some library functions.