lib: fix compile errors