Fixed histogram calculation
Minor changes to tester
improved Quiet zone capture
simplify matrix border zone expansion