Fix inventory crash.