bug-fixes in mutils.cpp