lib: fixes