The reason is why your script stopped working because if the variable killerid is INVALID_PLAYER_ID then it means that it goes out of bounds from array.
To elaborate, a script halt is the result of an array attempting to reach beyond its boundaries. Reacts equally to 'return 0;'