Fix category discussion counter on move

Ensure that discussion counter increments when a discussion is moved to a new category. Convert tabs to spaces and add braces to all control statements.