Applied patch from Shoham Peller for fixing issue #84