Fix jshint errors. Add debug logging.