Fix some sequence scripts bugs