remove typos and unused/ifdefed code