SOCHI, Russia — It was 2:30 a.m. and the stranger on the other side of the door wanted into my hotel room.
"How many cards do you have?" he kept asking in broken English.
The lock rattled and eventfully broke. Still hazy from sleep, I did all I could to keep him from forcing the door open. Finally, he backed away as more footsteps hurried down the hall.
A new speaker identified himself as the hotel manager. He said the late-night intruder was a locksmith mistakenly sent to change the lock.
"I am sorry," the manager said.
The days leading up to the Sochi Olympics generated endless stories of glitches and misunderstandings in this summer resort town beside the Black Sea.
Hotel rooms lacked basic amenities such as light bulbs and curtains. Toilets would not flush. The city resembled a giant construction site, littered with stacks of wood and piles of dirt.
As the opening ceremony approached, Sochi seemed unprepared to handle the world's grandest sporting event.
But the Games are no stranger to bumpy starts. No host city can be truly ready for hordes of athletes, journalists, officials and fans. When competition began in earnest this weekend, it appeared the Russians were putting the pieces together just in time, complaints giving way to cautious praise.
"Everything's a process," said Tyler Watchorn, a fan who came to watch his sister, Tara, play for the Canadian hockey team. "It's been getting a lot easier."
Over the last few days, Watchorn has learned to leave for events a little earlier, to compensate for the wait at security checkpoints. Others have faced tougher adjustments.
Many of the early complaints came from journalists, among the first to arrive in Sochi.
Hotel fire alarms rang for no reason at night and buses ran behind schedule. Stacy St. Clair of the Chicago Tribune sent a message on Twitter about brown water from her bathroom tap and a warning from the front desk: "Do not use on your face because it contains something very dangerous."
Some people arrived in Sochi to find their hotels still under construction. Phil Mielke, a fan from Wisconsin, made reservations in May and was told just days before leaving the United States that his room would not be ready.
International Olympic Committee officials downplayed the problem, saying that only 3% of 41,000 rooms were unfinished, most of them in the mountains.
"I have some travel experience, and I know how embarrassing it is when you arrive after a long flight to a place and your room is not ready," IOC President Thomas Bach said. "There are still some issues to be settled."
Local officials scrambled to find emergency accommodations, placing Mielke and others like him in nearby hotels. Workmen began making repairs to substandard rooms.
Though no magical transformation took place — the dirt piles did not disappear overnight — Sochi started becoming more functional.
The situation was more pressing at Rosa Khutor Extreme Park, the venue for snowboarders and freestyle competitors.