Fixed bugs with random lines.