Fixing some dead code and coding standard