Fix issues with layer visibility button.