Added error table support to dbload.pl
Close spool file upon function return/exit (apparently the file doesn't get closed automatically and results in corrupt output).