Fix intermittent crash on item gen.