Improve dictionary key checking.