he had fought two of the clockwork automatons in the stairwell and had thought he was done for , until the first one-having been run through several times with thomas 's sword-began to malfunction and pushed the second creature out a window before collapsing and crashing down the stairs in a whirlwind of crumpling metal and shooting sparks .