Fixed crash bug in cmd_randomitem