Fix system variable cache exception (bug #366)