Fix crash for #51.