fix a bug in shape analysis