error.c bug fixes