Fix failing tests and PHPCS errors.