I think I found a bug that allows you to finish the game incorrectly as well. It thinks it reaches the end so it makes you win.