Added tests and fixed lifecycle reporting