Ported upgrade to pydriver