Take the side trims and side window trims off to get it out properly without 'bending' it.
When you put it back, get someone to assist you. The little white clips at the rear are a bitch to get all in properly. Line them up, and whilst someone holds a torch for you, use a really loooong blade screwdriver and push each clip in individually working from one side to the other.
This will evenly pull the shelf back into position nice and even, then just push in the two small christmas trees and your rear seatbelt trims and job done.