Formatting and variable fixes

Fixes in the formatting, unused variables, and deprecated code