fix hdp minSpan and a null pointer