Fixed a potential bug when another train passes even if there aren't any
passengers left.