fix some undeclared variables
#103: Fix double redirects