Fix a core dump issue, see #1