mm bug fixes loop tweak