Bunch of changes to work with selenium