Better exception message when deleting templates