Fixed a bug in so-pmi generation