Detect only one comment and skip import, turn error counting logic in settings template into functions