Fix undefined variable. Closes #443