Fixed a bunch of warnings and errors.  Have set up a debug.log.