Fix before/after execution order. Closes #66