The window not stopping where it should is because it needs to "learn" at what point the window is closed.
After you have closed the window completely, press and hold the switch in the up position for around 20 seconds and it should be all sorted.
If you have had the motor remove from the mechanism and repaired/replaced cables.
If mechanism when reaching full up goes down a third then motor must be removed and run without the window mechanism .
You need to plug the motor in and through window switch make it go in the up position.
The motor will spin for quite some time and eventually stop.
Unplug and set the window mechanism to approximately a third up from the bottom, refit the motor ,fit the mechanism in place, and fit the window to the mechanism.
It should work without any issues.
If mechanism when reaching full up goes down a third then motor must be removed and run without the window mechanism .
You need to plug the motor in and through window switch make it go in the up position.
The motor will spin for quite some time and eventually stop.
Unplug and set the window mechanism to approximately a third up from the bottom, refit the motor ,fit the mechanism in place, and fit the window to the mechanism.
It should work without any issues.