Fixing security-contraint bugs