fixes #1951 and #1945