Fixes #665