Fixed some error reporting