improve dictionary.m: more rigid check of number