Fix mime type detection (plain vs binary)