Fix bug in check on permitted commands from given node state.