Fix for removeField method

I noticed that this doesn't work so Here is what I think the fix should be.

There were undefined variables being referenced so calling `removeField` would blow up immediately.