Fixed bugs.

I fixed the bug of not being able to buy certain items and fixed the
problem of ending my game.