Closes issue #1666