The government says it has ended a controversial contract with a ferry company that had no ships.