Fixes issue #591

Reverts 67b105793e97f1b60d5a5632ca12d8a908d04607