integrate map validation to map editor
fixed the logical bugs in ValidateMap(counters must be initialized
each time before return)