Fixes #5550: correct classes conditions when using quotes