Fixed a few undefined variables