One of the simple things that can mess up a minecart system is a stray minecart. A minecart headed in an unintended direction can screw up boosters, stop other minecarts, cause wars and famine, and generally be a nuisance. However, there are simple ways to get solve problems caused by stray minecarts. One is to take advantage of the t-junction in order to turn stray carts around without affecting other carts. Take a look at this rail structure here.
This weird looking loop can only be traveled though in one direction, making it an effective barrier against stray carts. These rail forms are called one-way junctions. Anything coming from the left will go straight, and anything coming from the right will be turned around and made to go to the left, making this rail one-way.
|Things coming from the left...|
|...will continue unhindered.|
|But things from the right will travel around the loop...|
|...and then also go to the left.|
|An illustration of how a minecart travels a p-junction. Courtesy of MSPaint.|
The one-way junction in the pictures above are made by curving a t-junction into itself, making a "P" shape. These are called P-junctions (I made up that name myself! Hurr Durr!). This isn't the only form a one-way junction can take, although it is the simplest. All of the following rail forms are also one-way.
There are hook-junctions:
|A one-way junction + a hook resetter|
|A one-way junction + a resetting booster|
And what I like to call a franken-junction.
|WTH is that? A p-junction + a hook junction + a booster + another hook junction + a j-junction?!|