Fixed undefined variable on exception throw.