added patch from m8rge (issue #103)

We have actually ran into the problems he described in his issue report and came up with the same solution, so this fix would be very much appreciated in the upstream repository.