This fixes nil pointers in repairing items

This fixes #114.