Implement flexible target specification

See commit message.
Isn't this "morestack": false?