fixes #820
fixes #1413