A few small performance tweaks and fiexs.