Fixed a few variable references

These are just a few variable type issues which block use of the current master. I needed to make these to test the memory leak fixes for PERL-267.