Fix parent state leaking between compile calls