fixed variable checks that generate warnings

Changed a few "if ($var)"'s to "if (!empty($var))".
It's not kosher to do a boolean check on a variable that you know might not be declared.