fixed segfault in distortion corr