Fixed overridden variables being persistent

Fixes #1450