Because of the high heat of the oven, it's impossible to keep M&M's from cracking in the oven. Instead, you can press the M&Ms into the cookies or bars right after they come out of the oven.