Fix for related pages showing up intermittently.

The DBkey uses underscores rather than spaces which was causing later code to not find categories of other pages properly.

Also added parenthesis for more explicit order of operations.

BugID: 99510