Patch undefined variables