Improve debug code a bit further