Fixed an error with inventory checks