Add tests and fix small issues
Add more tolerance to errors and properly discount failed items