Corrected client crash when a custom inventory is the first inventory opened, fixes #27