Global before/after scope fixed