Patch for Issue #227

The patches discussed in issue #227.