Fix duration handling bug
Use underscore for unused counter variable
Improve search failure error message