tweaked some error detection/reporting