Making the debug printing more flexible (handles more keys)