don't try template names we know to be invalid

if template_file is empty, only one choice makes sense: module name