In the bookshelf scene I needed to remove a rig that appears in a few frames of the shot which supports the books that falls to the floor.
I imported the footage into After FX with a 'clean image' behind it(a JPEG image that doesn't contain the rig, the background with nothing in front of it).
I used the pen tool to create a mask around the rig and then ticked the inverted box on the mask layer. This bought the clean image inside the masked area removing the rig.
I then made sure to move the mask out of the way on the other frames so they were not affected too.
I noticed that an unwanted shadow also appears in this shot near the end. I applied the same masking process to the shadow and was able to remove this aswell.