Fixed crash with inv