Fixed a bug introduced with changes from Issue #40