Added additional error handling support.