Changes to make it work on zappa
fixed merge on calcphasecorrection.pro