Fixed some class variable bugs