Update of tests which caught a few bugs.