Minor changes to speed up performance.