FIXED: variable 'mid_start' is used uninitialized