Card #275 various security fixes for messages