Added debug loggings.