Add a benchmark, fix infinite loop, allow debugging to be turned off