Fix: Better error management