fixed using of strncpy & str->num convertions
fixed wrong answer in case of wrong last_event_time