Fix pasto in previous.
off by one in out of bounds calculations (Jan Kaluza)