Troubleshooting and debugging detection scripts