Bug fixes so that tests run without error.