Context fixes for resources.
Merge pull request #230 from johnou/context_fixes

Context fixes for resources.
Merge remote-tracking branch 'upstream/ThePirateBay' into ThePirateBay