Fix ad-migrate script mode check