fixes #1012