BUGFIX to Go-Back-N algorithm