Fixed Bugs with checking for broken rails