Fixes #3. Changes IndexError try statments to KeyError.