It's necessary to remove the locked class (we will then add it back, only if necessary).

I want to start the render in a clean state. Therefore I thought it was better to clear all the classes. Often we call removeAll or something like that.