Some bug fixes to TurnOn/Off Dict