Fix of free_with_check.
Fix exception messages in RefMap.