Fix for upstream/issues/665

#665