Fix for bug pointed out in PR 52 by @afgane.