Added more extensive deriver test.

Also fixed some errors the new test revealed.