Manually merging in fix for issue #5