I think row 297 of control.lua can fix the issue
local to_insert = math.min(player.get_item_count(name), required)
=>
local to_insert = math.min(player.get_item_count({name = name, count = required, quality = quality}), required)
(almost did a pull request to git already, but ran into some ssh issues....)