some fixes to lib