Fixed typo in footer code and handling of custom ->template values