Fixed some bugs related to lib

Signed-off-by: Herbert <herberthb12@gmail.com>