Bugfix: undefined variable

The string used to create an exception contained an undefined variable.