Added some performance improvements.