Fixed bug in function multerm matching.