Partial C99 cleanup of term.c