I didn't really look at your code (should do that though), but I'm using a modified version of the improved player movement code and I've never had the problem of sinking in the floor after a jump. So I figure it might be worth your time to take a look at the simple jump code in it and see what they did differently.