Bug fixes in the driving code