Fixed some minor issues regarding private variables and unused vars