lib: fix a couple of return values