some debug improvements