Possible fix for a very strange bug. Without braces around the if statement, the bans aren't inserted as a record on Windows. Adding braces appears to resolve the issue.