Bug fixes and more classes that can be mocked for testing