ahh, it could've been the missing code causing problems, or it could've been just a simple syntax error in a block of code before the main categorys bit. If there is a syntax error (single quote mark missing, or a semi colon missing) the code that comes after that will break.
Chances are the code for the categories bit was fine, it was the code that gets loaded before that, that would've had a tiny error in it

If there is a semi colon missing from the end of a line of code, then that line of code will end up being joined to the next line of code, because there is no stop function (the semi colon is the signal to stop that line of code and start a new line) so the two lines of code end up being mashed together, inturn breaking the code.
Its always a tiny syntax error that tends to break things in a big way lol