Kennedy, our 12 year old Sharpei, has always been prone to the overnight "accident" particularly if he doesn't get his evening walk. He was always good enough to do it in the basement, but its still no fun for us.
Very recently he learned that if he stands by the door and barks - once every 10 seconds or so - sooner or later, someone will come and open that door and he can go out into the backyard and do his business. Typically this happens between 4am and 6am, which is unfortunate, but vastly better than cleaning a smelly mess.
What a revelation! What a revelation for a 12 year old dog! There's hope still for us old people.
Unfortunately - he's learned the power of that barking near the door. He wants to go out? He barks. He wants a biscuit now? He barks. He wants some attention? he barks.
The newest one was the coolest - 30 minutes after barking to let him out at 5am, he was barking again. My turn, my wife let him out 30 minutes ago. I went downstairs, but he had no interest in going out. Or getting attention. Or eating something.
He was barking because the cat was outside and wanted to come in. Seriously.
He's done that several times now. I'm blown away.