Fixed implicit variable declarations and unneeded commas.

Please check!