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.
Through years of construction delays and allegations of corruption among builders, the Sochi organizers had insisted that the most important part of the Games — the sports facilities — would be ready.
But as practice began on the slopestyle run last week, two snowboarders were injured, prompting complaints that the course's jumps were too big.
"It is like jumping out of a building," Canadian rider Sebastien Toutant said. "I should put on my Canadian flying squirrel suit."
Officials reacted quickly, making adjustments, and by the time U.S. rider Sage Kotsenburg won the gold medal Saturday, safety concerns had faded.
"The jumps were really high here," Kotsenburg said, "but we need those big jumps to do the tricks."
Throughout the weekend, Sochi's other venues drew mostly high marks from the athletes.
"The ice here is fantastic, and the facilities are amazing," Canadian curling captain Jennifer Jones said after practicing at the Ice Cube Curling Center. "We couldn't have asked for anything better."
At the men's downhill, two skiers crashed in training. But as U.S. racer Bode Miller recorded the fastest time Saturday, the rest of the field shrugged off icy patches and treacherous bumps on the course.
Aksel Lund Svindal, the veteran skier from Norway, said: "We are supposed to be the best in the world, so we have to handle it."
The fans, meanwhile, seemed to enjoy themselves on the first full day of competition.
Jenny Kelpe didn't mind passing through security at the snowboard venue up in the mountains. It made the Sacramento woman feel safe, and besides, she said, "flying out of LAX is a little more of a hassle than here."
Down by the coast, crowds drifted through Olympic Park, where clowns danced around the medals plaza, the futuristic torch burning as loud as a jet plane overhead.
A brass band played and a volunteer in a brightly colored patchwork uniform danced as she directed fans toward the arenas.
"We're having so much fun," said the young woman, who did not give her name because she was not authorized to speak with reporters. "Everything is going great."
Inside Shayba Arena, the stands were only about half full for women's hockey but the crowd was enthusiastic. Watchorn let out a cheer when his sister scored in Canada's victory over Switzerland.
"I heard some horror stories before we came," he said. "But just being here at the Olympics, the people have been so welcoming."
Not that everything went perfectly.
Earlier in the day, U.S. bobsledder Johnny Quinn tweeted that he had become locked in a bathroom at the athlete's village. An accompanying photograph showed a door with a large, jagged hole after he broke out.
And at the halfpipe, where the snowboarders practiced for the start of their competition on Tuesday, there was talk of the walls being too steep.
"It has a little too much vert," two-time gold medalist Shaun White said. "But that's an easy fix."
There was still work to be done in Sochi.