Refactorings and tests

The ROIProtection is well enough tested now.
Some more tweak on the ROIProtectorTest.
Fixed regression in the ROIProtector.
Merge branch 'master' into 2013-01-26#Capture#