Added more Exceptions handling.