Closes issue #1581