Fix locks when automatic inventory