Patch to fix PR102, contributed by Reid Spencer.