Style and unused code fixes