Fixes #1098
Fixes #1127