Incorrect error reporting fixed