Fix for #84.

This is a fix for #84. See comments on that issue for details.