Implemented fix for files with same name, some clean up in mmapi.inc