Some style fixes and dead code removal