Clean up warnings. Apply consistent tab formatting. Remove dead code.