Error patch

Several errors found while updating templates etc.