Set the correct vars for the category, and got rid of some superflous code.