more fixes to the lib