Possible fix for #246. Please test this and the previous build separately, don't want to include this change if it's not necessary.

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