Fixes bugs in the add command.