Untested fix for #1097

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