Fix for issue #1504