Closes #1582
More work on issue #1582