Added some log messages for debugging.