Fixes #1791.