Wrap driver code in closure.
Merge pull request #3311 from brendandahl/wrap-driver

Wrap driver code in closure.