some fixes and improvements in dictionary