Code cleanups.
Replaced throws with console.error() calls.