Bug fixes as a result of tests and testing