Fix trunk brokenness; also, optimize application registration