Removed some redundant code and fixed spawn of player