Fixes #700 and #1184