Add set_compat and some fixes