Fixing wrong casts of static variables [ci skip]