Swicthed to non-macro style state machine, as although it was making the syntax shorter, it was confusing things. Now using strings as the unique identifier for each state.