More optimizations, cleanup #ifdef stuff.