Fix bug that caused game end to occur one wave cycle too late.