Fix checkStyleToggleVisibility

The `for` loop just seems like an ugly hack though...