Logging cleanup
Remove redundant debug statements, use console.error where needed.