Bugfix straight rail
Some changes