Fix indentation, code style and remove dead code.