Fix life-cycle aware handlers processing in the default pipeline, add tests.