Some security fixes