I had seen it follow its mistress upstairs when she went to bed; and wondered much how it could have got out there, and what mischievous person had treated it so. 
I quickly released the dog, wondering how it could have got there, and who had treated it so. 