Minor bug fixes.
Fixed a few tests.