Add more Exception management and tests