Ran into the end turn null reference bug again.
Here is the current commit.