Fixes for new decoding architecture

Run state management and bugs were fixed.