minor fixes, added MAC unit tests