FIX: Some variables in IF-RULE weren't local