Revert "Fix #917"

This reverts commit d7bcf12b2d9f5fdd29ba253e0379ca3ab48c4ab2.
Better fix for #917

Signed-off-by: Ross Allan <rallanpcl@gmail.com>