Fixing Variable access warnings