Fixed before/after hook tests.