Libs: Various fixes