fixes #1049
fixes #841