Fix bug with saving dictionary.