Fixed Coredump when accessing negative indexes