Adds some debug logging