Adding a handy debug utility and removing some lingering debug code