Prevents KeyError when index does not exists.