Fix #9. Still segfaults, now before input.