Fix bug with error report