Better exceptions handling.