fixes #1181, fixes #1715