Fix class mismatch issues