Issue has been solved. This is how I did it in case someone has the same issue.
In Nvidia X Server Setting I disabled the Xcreen 0 and Xcreen 1.
I selected a proprietary driver. The 340 one. (When I used the 381 one it didn’t work.)
Rebooted. Then made the HDMI connected screen the primary screen and the VGA screen the right one to the primary screen in NVIDIA X Server settings. Then rebooted to see the effects. Before ubuntu-mate 17.04 when I pressed apply you could see the effects immediately.
This post also helped me and worth looking into: Dual monitor configuration issue