Hopefully fixes #877