Merged pull request #64 into the PCL version to enable some advanced chaining scenarios.