Heading for comment section
This is the default behavior of Garland. Have a look in the themes/garland/template.php file:

function garland_preprocess_comment_wrapper(&amp;$vars) {
  if ($vars['content'] &amp;&amp; $vars['node']-&gt;type != 'forum') {
    $vars['content'] = '&lt;h2 class="comments"&gt;'. t('Comments') .'&lt;/h2&gt;'.  $vars['content'];
  }
}


Where did you put your code? Depending on your theme, you most probably want to theme comment-wrapper.tpl.php, which only gets output when there are comments to be displayed. Which what you want. :-)