Bugfix/security tweaks