fixes #1001
fixes #979