Fixed bug generating target context when task options is undefined.