Changed the player collision detection code. Doesn't seem to glitch out now, but I didn't test every possible case.