Mime type added, and stack smashing fixed.