Add content type to body class
The problem is you're trying to use the same system_main content type variable that's not always defined. Try this instead:

$node = menu_get_object();
$type = isset($node-&gt;type) ? $node-&gt;type : 'none';
$type = ($type == 'none' &amp;&amp; arg(0) == 'node' &amp;&amp; arg(1) == 'add') ? arg(2) : $type;
$content_type_class = 'content-type-'.$type;
$variables['classes_array'][] = $content_type_class;


That should give you a $classes_array var with either "content-type-TYPE" or "content-type-none" for pages that aren't associated with nodes.