When moving items in and out of Anvil slots, you will be left with items in stacks of 0 and ghost stacks of items.
First screenshot is Starting Inventory, second is putting starting item in anvil, third is quick-moving (shift-click) a stackable item to the anvil slot, fourth is quick_moving another stakcable item in, fifth is after you quick-move the stack out, which stacks both to the stack of 0 and the first open slot, leaving a ghost item in the lower stack; and the final screenshot is just the ghost items after exiting and reentering your inventory.
Dupe of MC-71367