Fix tests.

Several tests do not pass.