Fix a bug in the code ported for libmunge