Fixed On/Off states not working correctly.