Exception fix

You're testing if position > -1. That means last iteration will be position == 0. You then do position--, which makes position -1. Then look for character at position -1, which is unexistent in an array.