Fixed disconnecing upon file switch.

Hardly clean patch will need a lot of refactoring.
MPC pretty much works with GUI now

Needs refactoring