More null checking. Fixing up log statements.