Added a batch driver that seems to work and fixed a bunch of little bugs.