Fix variable reset in SIP (bug #2916)