We just bought a N 51151 4-4-0 steam loco and the front 4, I guess the leading wheels, don't seem to want stay on the rails. To the point I wonder if they are even intended to and are instead just for decoration. If they are supposed to stay on the rails is there some adjustment that can help? They just seem to bounce around...

I am assuming that you refer to the B-mann nineteenth century eight wheeler as opposed to the Atlas nineteenth century eight wheeler or Model Power late nineteenth/early twentieth century eight wheeler.

What version do you have? Did it come in a set or did you buy it separately? If you bought it separately, did it come in a plastic or cardboard box?

If it is the plastic box version, you should not be having any problems with it. The plastic box version is that latest version. B-mann made a host of corrections to it that significantly upgraded the quality and performance. There are some very late cardboard box versions that also have major improvements.

The older versions had their problems and varied wildly in performance.

For now, make sure that all of your track joints are aligned properly. Misaligned rail joiners are a common cause of derailments, especially of pilot trucks on steam locomotives. Make sure that the points of the turnouts are aligning properly. Picking points and frogs is another not uncommon cause of steam locomotive pilot trucks' derailing.

Make sure that all wheels are in gauge. Out of gauge wheels are a common cause of any derailment.

Did you buy this new or used? If you bought it used, check the pilot wheels for accumulated wheel crud. Wheel crud will cause derailments, especially on rough track joints, points and frogs.

Another possibility is to flip over the pilot truck. The pilot truck on some B-mann 4-6-0s likes to derail. There is no consistency to this, it just seems to happen on some of the locomotives, but not all. Many have reported solving this problem by flipping over the pilot truck. Another possibility is that the spring is missing or the screw that holds on the pilot truck is too tight.