Sofie and Christian accidentally ran over Malin and buried her body in the woods.
Sofie hasn't been the one haunting Megan. It's been Malin trying to show her where she was buried. The teddybear keychain that keeps popping up has a key to Malin's bike chain on it. Megan leads her friends to the sinkhole she stepped in earlier and digs up Malin's body. Christian is overwhelmed by guilt and accidentally shoots Mark in the car while they drive to get the police. He runs back with the gun to Megan and the body trying to explain that it was an accident, but he didn't want Sofie's life and his life to be ruined by it. Sofie committed suicide rather than confess the truth.
While chasing Megan, he runs in front of a police car and is hit like Malin was. He dies and everybody feels closure.