Fixed bugs, brought unit tests up to date.