fixes for lib.c