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.
Merge pull request #6 from jordanlev/patch-3

fixed variable checks that generate warnings