[TASK] Improve error tolerance and provide better debug messages