A few fixes to appease R CMD check; that involving overlap.threshold may have been a bug