Fix coding style and remove some stale code/comments