How did the dwarves get out of the palace?