Cleaning up some SEQUENCE_COMMAND logic
Added test cases