Security checks

I was wondering if this it a good thing to do or it is better to keep everything in one place...dunno.

Based on a not yet merged branch so it brings with him some unrelated commits...