Constrained the search for pieces to a reasonable upper limit on piece count
#186 - added timeout for latch detection processing