Updated to use ReturnTargetError instead of homegrown error method.