added target check in ProcessDirective
fixed ProcessDirective, test