templates: minor fix
hooks: do not update manual index cache if directory does not exist anymore