Added some logging for diagnostic.