Some set-up to allow tests for the protection stuff.

This is getting annoying to work with...