Merge "Guard JOIN in case the state machine gets into an erroneous state" into jb-mr1-dev