doAfter may break a tight group, since next returns the command itself and there i no way to figure out where the current group ends.
next should return growing tight group, which can be passed to doBefore and doAfter.
(I think this was the intention how to implement it, but it does not work for some reason)