Fix clearing of dictionary