Added paranoid routines to error.c