Added some performance enchancements.