Fixed previous correction for other versions of sed
Added alternate coalesce checks for series 3