Add unit tests and fix source for failing tests
Add previously missed files