Fixed some issues with toggle button behavior.