fixes #877 #876