Check length to prevent IndexErrors

I always got an IndexError for certain input. Just using b[-3] is not safe. Even if b.endswith('er') is true, b could still be less that three chars long (<=> b = 'er'). Example: "erst" raises an IndexError. It's not a noun of course, but still should not raise an IndexError.