Added the missing checks and corrected some tests.