Setting the length of the ray to maxRangeP results in a ray of length maxRangeP starting at the origin of the ray, which is at a distance of minRangeP from the center of the sensor (and in the appropriate direction). To get the right length, it has to be set to maxRangeP - minRangeP. Otherwise the range of the sensor will be maxRangeP .+ minRangeP.
fixed error in patch file 3/11/09