  Commercial photon-counting modules based on actively quenched solid-state
avalanche photodiode sensors are used in a wide variety of applications.
Manufacturers characterize their detectors by specifying a small set of
parameters, such as detection efficiency, dead time, dark counts rate,
afterpulsing probability and single-photon arrival-time resolution (jitter).
However, they usually do not specify the range of conditions over which these
parameters are constant or present a sufficient description of the
characterization process. In this work, we perform a few novel tests on two
commercial detectors and identify an additional set of imperfections that must
be specified to sufficiently characterize their behavior. These include
rate-dependence of the dead time and jitter, detection delay shift, and
"twilighting." We find that these additional non-ideal behaviors can lead to
unexpected effects or strong deterioration of the performance of a system using
these devices. We explain their origin by an in-depth analysis of the active
quenching process. To mitigate the effects of these imperfections, a
custom-built detection system is designed using a novel active quenching
circuit. Its performance is compared against two commercial detectors in a fast
quantum key distribution system with hyper-entangled photons and a random
number generator.
