Improve error reporting for '#' characters in config entries. refs #2128

Signed-off-by: Daira Hopwood <daira@jacaranda.org>