Fix loads of warnings in policy code.