Further improvements to MIME type detection