Removed a couple of extraneous debug logging calls.
Added a couple of isset checks.