type mismatch cleanup