The loop over timesteps in ConformationalFunctions.py where the dihedral angle values are being collected might be missing the last frame. This then results in a count of 1 for the zero bin of the histogram even when that is not a correct value for the angle.