Fix #176 by guarding against ? being the last character.