Security fixes in the admin panel

And some other changes
TODO!