Fix some compiler warnings
General clean up

Remove unused code, fix spelling, fix code style.