small fixes in lib