Bug fix: Writing some empty directives will break a host. Do some sanity checks and write only what is needed.
diff --git a/templates/host.pl.erb b/templates/host.pl.erb
index b34fbbc..e842221 100644
--- a/templates/host.pl.erb
+++ b/templates/host.pl.erb
@@ -24,7 +24,7 @@
 <% if @incr_fill -%>
 $Conf{IncrFill} = <%= @real_incr_fill %>;
 <% end -%>
-<% if @incr_levels.is_a?(Array) and  @incr_levels.count > 0 -%>
+<% if @incr_levels.is_a?(Array) and  !@incr_levels.empty? -%>
 $Conf{IncrLevels} = [<%= @incr_levels.join(', ') %>];
 <% end -%>
 <% if @partial_age_max -%>
@@ -36,10 +36,10 @@
 <% if @ping_max_msec -%>
 $Conf{PingMaxMsec} = <%= @ping_max_msec %>;
 <% end -%>
-<% if @blackout_good_cnt -%>
+<% if !@blackout_good_cnt.empty? -%>
 $Conf{BlackoutGoodCnt}      = <%= @blackout_good_cnt %>;
 <% end -%>
-<% if @backup_files_only -%>
+<% if !@backup_files_only.empty? -%>
 <% if @backup_files_only.is_a?(Hash) -%>
 $Conf{BackupFilesOnly} = {
 <% @backup_files_only.each_pair do |key,value| -%>
@@ -52,7 +52,7 @@
 $Conf{BackupFilesOnly} = '<%= @backup_files_only %>';
 <% end -%>
 <% end -%>
-<% if @backup_files_exclude -%>
+<% if !@backup_files_exclude.empty? -%>
 <% if @backup_files_exclude.is_a?(Hash) -%>
 $Conf{BackupFilesExclude} = {
 <% @backup_files_exclude.each_pair do |key,value| -%>
@@ -65,75 +65,75 @@
 $Conf{BackupFilesExclude} = '<%= @backup_files_exclude %>';
 <% end -%>
 <% end -%>
-<% if @smb_share_name %>
+<% if !@smb_share_name.empty? %>
 $Conf{SmbShareName} = '<%= @smb_share_name %>';
 <% end -%>
-<% if @smb_share_username -%>
+<% if !@smb_share_username.empty? -%>
 $Conf{SmbShareUserName} = '<%= @smb_share_username %>';
 <% end -%>
-<% if @smb_share_passwd -%>
+<% if !@smb_share_passwd.empty? -%>
 $Conf{SmbSharePasswd} = '<%= @smb_share_passwd %>';
 <% end -%>
-<% if @smb_client_full_cmd -%>
+<% if !@smb_client_full_cmd.empty? -%>
 $Conf{SmbClientFullCmd} = '<%= @smb_client_full_cmd %>';
 <% end -%>
-<% if @smb_client_incr_cmd -%>
+<% if !@smb_client_incr_cmd.empty? -%>
 $Conf{SmbClientIncrCmd} = '<%= @smb_client_incr_cmd %>';
 <% end -%>
-<% if @smb_client_restore_cmd -%>
+<% if !@smb_client_restore_cmd.empty? -%>
 $Conf{SmbClientRestoreCmd} = '<%= @smb_client_restore_cmd %>';
 <% end -%>
-<% if @tar_share_name -%>
+<% if !@tar_share_name.empty? -%>
 <% if @tar_share_name.is_a?(Array) -%>
 $Conf{TarShareName} = ['<%= @tar_share_name.join("', '") %>'];
 <% else -%>
 $Conf{TarShareName} = '<%= @tar_share_name %>';
 <% end -%>
 <% end -%>
-<% if @tar_client_cmd -%>
+<% if !@tar_client_cmd.empty? -%>
 $Conf{TarClientCmd} = '<%= @tar_client_cmd %>';
-<% elsif not @system_account.empty? -%>
+<% elsif !@system_account.empty? -%>
 $Conf{TarClientCmd} = '$sshPath -q -x -n -l <%= @system_account %> $host'
 . ' env LC_ALL=C $tarPath -c -v -f - -C $shareName+'
 . ' --totals';
 <% end -%>
-<% if @tar_full_args -%>
+<% if !@tar_full_args.empty? -%>
 $Conf{TarFullArgs} = '<%= @tar_full_args %>';
 <% end -%>
-<% if @tar_incr_args -%>
+<% if !@tar_incr_args.empty? -%>
 $Conf{TarIncrArgs} = '<%= @tar_incr_args %>';
 <% end -%>
-<% if @tar_client_restore_cmd -%>
+<% if !@tar_client_restore_cmd.empty? -%>
 $Conf{TarClientRestoreCmd} = '<%= @tar_client_restore_cmd %>';
 <% elsif not @system_account.empty? -%>
 $Conf{TarClientRestoreCmd} = '$sshPath -q -x -l <%= @system_account %> $host'
 . ' env LC_ALL=C $tarPath -x -p --numeric-owner --same-owner'
 . ' -v -f - -C $shareName+';
 <% end -%>
-<% if @rsync_client_cmd -%>
+<% if !@rsync_client_cmd.empty? -%>
 $Conf{RsyncClientCmd} = '<%= @rsync_client_cmd %>';
-<% elsif not @system_account.empty? %>
+<% elsif !@system_account.empty? %>
 $Conf{RsyncClientCmd} = '$sshPath -q -x -l <%= @system_account %> $host $rsyncPath $argList+';
 <% end -%>
-<% if @rsync_client_restore_cmd -%>
+<% if !@rsync_client_restore_cmd.empty? -%>
 $Conf{RsyncClientRestoreCmd} = '<%= @rsync_client_restore_cmd %>';
-<% elsif not @system_account.empty? -%>
+<% elsif !@system_account.empty? -%>
 $Conf{RsyncClientRestoreCmd} = '$sshPath -q -x -l <%= @system_account %> $host $rsyncPath $argList+';
 <% end -%>
-<% if @rsync_share_name -%>
+<% if !@rsync_share_name.empty? -%>
 <% if @rsync_share_name.is_a?(Array) -%>
 $Conf{RsyncShareName} = ['<%= @rsync_share_name.join("', '") %>'];
 <% else -%>
-$Conf{RsyncShareName} = '<%= @rsync_share_name %>'; 
+$Conf{RsyncShareName} = '<%= @rsync_share_name %>';
 <% end -%>
 <% end -%>
 <% if @rsyncd_client_port -%>
 $Conf{RsyncdClientPort} = <%= @rsyncd_client_port %>;
 <% end -%>
-<% if @rsyncd_user_name -%>
+<% if !@rsyncd_user_name.empty? -%>
 $Conf{RsyncdUserName} = '<%= @rsyncd_user_name %>';
 <% end -%>
-<% if @rsyncd_passwd -%>
+<% if !@rsyncd_passwd.empty? -%>
 $Conf{RsyncdPasswd} = '<%= @rsyncd_passwd %>';
 <% end -%>
 <% if @rsyncd_auth_required -%>
@@ -142,28 +142,28 @@
 <% if @rsync_csum_cache_verify_prob -%>
 $Conf{RsyncCsumCacheVerifyProb} = <%= @rsync_csum_cache_verify_prob %>;
 <% end -%>
-<% if @rsync_args.is_a?(Array) and @rsync_args.count > 0 -%>
+<% if @rsync_args.is_a?(Array) and !@rsync_args.empty? -%>
 $Conf{RsyncArgs} = ['<%= @rsync_args.join("', '") %>'];
 <% end -%>
-<% if @rsync_restore_args.is_a?(Array) and @rsync_restore_args.count > 0 -%>
+<% if @rsync_restore_args.is_a?(Array) and !@rsync_restore_args.empty? -%>
 $Conf{RsyncRestoreArgs} = ['<%= @rsync_restore_args.join("', '") %>'];
 <% end -%>
-<% if @dump_pre_user_cmd -%>
+<% if !@dump_pre_user_cmd.empty? -%>
 $Conf{DumpPreUserCmd} = '<%= @dump_pre_user_cmd %>';
 <% end -%>
-<% if @dump_post_user_cmd -%>
+<% if !@dump_post_user_cmd.empty? -%>
 $Conf{DumpPostUserCmd}    = '<%= @dump_post_user_cmd %>';
 <% end -%>
-<% if @dump_pre_share_cmd -%>
+<% if !@dump_pre_share_cmd.empty? -%>
 $Conf{DumpPreShareCmd}    = '<%= @dump_pre_share_cmd %>';
 <% end -%>
-<% if @dump_post_share_cmd -%>
+<% if !@dump_post_share_cmd.empty? -%>
 $Conf{DumpPostShareCmd}   = '<%= @dump_post_share_cmd %>';
 <% end -%>
-<% if @restore_pre_user_cmd -%>
+<% if !@restore_pre_user_cmd.empty? -%>
 $Conf{RestorePreUserCmd}  = '<%= @restore_pre_user_cmd %>';
 <% end -%>
-<% if @restore_post_user_cmd -%>
+<% if !@restore_post_user_cmd.empty? -%>
 $Conf{RestorePostUserCmd} = '<%= @restore_post_user_cmd %>';
 <% end -%>
 <% if not @user_cmd_check_status -%>
@@ -172,10 +172,10 @@
 <% if @email_notify_min_days -%>
 $Conf{EMailNotifyMinDays} = <%= @email_notify_min_days %>;
 <% end -%>
-<% if @email_from_user_name -%>
+<% if !@email_from_user_name.empty? -%>
 $Conf{EMailFromUserName} = '<%= @email_from_user_name %>';
 <% end -%>
-<% if @email_admin_user_name -%>
+<% if !@email_admin_user_name.empty? -%>
 $Conf{EMailAdminUserName} = '<%= @email_admin_user_name %>';
 <% end -%>
 <% if @email_notify_old_backup_days -%>