This update mainly tightens the error handling.