Straightforward warnings removed, some dead code removed.