Added some performance tweaks.