Fix #606.
Fix #617