[BUGFIX] template errors can hit an exception path that references an
undefined variable
Add debian wheezy support