Respond to review by restoring LOCAL where appropriate.
Also enhanced documentation in detection.py