Fixing invalid waits in driver, and building more unit tests