Weighted Manhattan null check added.