Made some improvements to child counting and AMLogAction3 database transaction.