Cleaning up typos and unused functions