Optimizations

After spending some time in Instruments, here are some optimizations. If you pick only one, pick 143f4cb.