Improve handling of player inventory