Fix bugs with TOS workflow