Write errors to logs
Fix tests
Add logs folder to repo
Fix pm tests
Fix main bin script