FIxed a bug in BaseEngine::removeAllState.
Merge remote-tracking branch 'origin/develop' into develop