Lots of tweaks to before/after (added contexts, run option.)