Improve the behaviour of the moveto function