Fork for Issue 491.

Fork with proposed fix for issue 491.