Updated fix for issue #381