Forward and backward filling of missing values