Fix the check_descriptors function error
Added a switch that enables debugging