That was really a very tall house elf. It was tall enough to be three house elves, actually, and Pete had a brief moment of conviction that it was three house elves, stacked on top of each other—followed by an even briefer moment of patting himself on the back for stunning three zombified house elves all at once—before he realized that, rather than a house elf (or three), it was William.
"William," Pete said brightly, grinning at the confused-looking and board-stiff librarian on the floor. "I thought you were a house elf. Or three."
He waved his wand at William, almost absently, muttering, "Finite Incantatem."