Fix gen_IM_data errors.
Initialize last_phr.
Fix init_database for non-phone IM.
Fix tree.c range for bsearch.