add castoff for traped target and fix many bugs

Signed-off-by: xiehuc <xiehuc@gmail.com>