Fixes #799
Fixes #798