Yeah, I tried to account for all cases where the track is whole and has no sudden breaks, but clearly left in a bunch of cornercases when that doesn't hold. I might look at them later.
i think the "jank" straight-turns adds a lot of character and makes solving for minimum rails really interesting, please don't patch it out!
the only thing i wouldn't mind being changed is that carriages crash whenever they go over straight rails perpendicular to their facing direction, don't know whether that's intentional but it allows for cheese in 2 of the carriage levels
oh, and you can't form turns that would go off the edge of the screen because your cursor isn't detected out there, which might actually be useful!