Added some more debug logging and monitoring