Fixed bugs in player movement