r22979: Revert previous checkin (which had some debug junk) and fix misc frees that