Added extra error reporting