Fixes #587.