Added logic to determine finite difference scheme to be used in the case of missing values.