Getting Derailed Tamping Machines Back on the Track