Updated fix for issue #1568 based on feedback