zeropoint correction fitting

fits the best zero point correction to the data. Still need to return
the value and apply it to the zero point, which will then be run again
in SExtractor again.
Some small bug fixes as well.