Maybe you might want to just skip relying on USB connectivity and use something like the Airdroid app for file transfers. No need to mess with any MTP or PTP or mass storage settings on your computer, Airdroid uses your wireless network so no physical cable is involved. And you don't need to add/install anything on your computer, all that's necessary is the app on your M8.
https://play.google.com/store/apps/details?id=com.sand.airdroid&hl=en
Install the app on your phone, launch it, and the screen will show a web site if you've created account with their service for remote access. But you can just skip doing that if your phone and computer/laptop are on the same local network. Under it in smaller type is another site, an IP address (based on your home network) with a port number -- something like
http://192.168.1.3:8888 On your computer using whatever browser you use (doesn't matter if you're running Linux, OS X, or Windows, or whichever browser your prefer) type in that exact same IP
ort and hit <Enter>. The browser window will show a screen representing your phone and you can just transfer files to and from your phone using your browser.