Cheap security fixes part 1

Cheap security fixes part 1