Fixed issue #6 (reported on github by Olivier Ligot).