Fixed the exception message. Relates to #1718