Fixing some variable rename bugs