Prevent index from being negative; remove old console debug completely