fixes #680, fixes #624