Fixed an error and modified error message. Refs #8518.