Actually calculate the prompt length

fixes #36
Merge pull request #37 from lestrrat/fix_prompt_len

Actually calculate the prompt length