Fix loads of warnings in policy code.

I'll remember to try to compile this with warnings enabled next time :-)
8 files changed