Allow use of Rects for evalDetection (and rearrange code for readability)
Fix R syntax error