Reimplemented things working with summed pixels, other fixes.