Fixes #346.