Merged my changes to player.d with upstream