Better mime handling