Added error handling support.