Fix "class variable access from toplevel" warnings