Fix type when accessing class