Removed trailing commas and unused duplicate variables

I decided to cleanup things I've found while reading the code.