Fixes issue #61

Will issue an equivalent PR for changes to canarylib