Fix bugs in edit dispensing