fixes #495
fixes #685