mapff fixes + unit tests