fixes #1721 and #1745