Added a directory check
Fixed a couple of template variables not being declared as globals in http_check