Small changes to better work on detect.py