Code cleanup fixes from Shane/Doug.