Fix mimetype detection