added more logs and other diagnostics and fixes.