Here is a patch that works for me. I had some issues the the token replacements, but I think I got them right.
Re-rolling patch using relative path against 7.x-1.x-dev.
Hi @grndlvl patch at https://drupal.org/node/1932122#comment-7771309
appears to work for the current dev release.
Drupal is a registered trademark of Dries Buytaert.