Improve end game detection