dictionary: fixed memory leaks