Optimize various common methods

Some more array optimizations.