Improved failures tests
Implemented logging in the script (still not perfect)