Fix a bug caused when hack with 1 shape.