I know this has been discussed before but having just replaced half of my trackage I experienced the front truck on my SPC 4 4 0 coming off the rails in various places.
Taking the idea from Kevin Strong I modified it a bit and have solved the problem. Basically I fixed a piece of sheet styrene to the top of the truck frame and drilled a hole to take a small round headed bolt and secured this with a nut on both sides of the styrene. The lower nut is kept from turning by enclosing it in a tight fitting cage made of the same styrene. The bolt was inserted and adjusted so that around 2mm of space was left between the top of the bolt and a cross member under the deck frame.
Result, no more derailing and once painted the styrene is all but invisible. Hope you can see this fix in the pic.
Regards
David