CSS classes now added in the correct hierarchical order.