Minor fixes in logic and handling empty request vars
Merge pull request #1 from peteward/pw-minor-fixes

Minor fixes in logic and handling empty request vars