Cleanup: Replaced console.log calls by calls to .debug