Fixed some logging and diag stuff.