Fixes #950
Fixes #1074