Just noticed that it works correctly with most of my products and attributes. The products it's not working with is the products and attributes using the add-on "Product Attribute Grid".