bugfixes in apply_array_location_correction