Fix buggy behaviour on accordions