Fixes #1311
Fixes #1392