Bit more error reporting and checking